package com.hong.servicehosp.controller;

import com.hong.commonutil.result.Result;
import com.hong.model.model.hosp.Department;
import com.hong.model.vo.hosp.DepartmentVo;
import com.hong.servicehosp.service.DepartmentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//@CrossOrigin
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("根据医院编号查询所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> departments = departmentService.getDeptListByHosCode(hoscode);
        return Result.ok(departments);
    }
}
